package com.resume.controller;

import com.resume.bean.PageBean;
import com.resume.domain.User;
import com.resume.domain.UserQuery;
import com.resume.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

/**
 * @Author: 梁云亮
 * @Date: 2021/7/22 10:46
 * @Describe:
 */
@Controller
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    @RequestMapping("/v1/listUser")
    public String listUser(UserQuery userQuery, Model model){
        System.out.println(userQuery);

        PageBean<User> pageBean = userService.pageUser(userQuery);

        model.addAttribute("data",pageBean);
        System.out.println(pageBean);
        return "user";
    }
}
